﻿using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace Kindler.IO.MobiFile
{
    [DebuggerDisplay("{Name} (No. Of Records: {NumberOfRecords})")]
    public class MobiFile
    {
        [MobiProperty(0, LengthInBytes = 32)]
        public string Name { get; set; }

        [MobiProperty(1)]
        public MobiFileAttributes Attributes { get; set; }

        [MobiProperty(2)]
        public UInt16 Version { get; set; }

        [MobiProperty(3)]
        public DateTime CreationDate { get; set; }

        [MobiProperty(4)]
        public DateTime ModificationDate { get; set; }

        [MobiProperty(5)]
        public DateTime LastBackupDate { get; set; }

        [MobiProperty(6)]
        public UInt32 ModificationNumber { get; set; }

        [MobiProperty(7)]
        public UInt32 AppInfoId { get; set; }

        [MobiProperty(8)]
        public UInt32 SortInfoId { get; set; }

        [MobiProperty(9, LengthInBytes = 4)]
        public string Type { get; set; }

        [MobiProperty(10, LengthInBytes = 4)]
        public string Creator { get; set; }

        [MobiProperty(11)]
        public UInt32 UniqueIdSeed { get; set; }

        [MobiProperty(12)]
        public UInt32 NextRecordListId { get; set; }

        [MobiProperty(13)]
        public UInt16 NumberOfRecords { get; set; }

        [MobiProperty(14)]
        public IEnumerable<MobiFileRecordMetadata> RecordMetadata { get; set; }

        [MobiProperty(15)]
        public IEnumerable<MobiFileRecord> Records { get; set; }

        public byte[] AllBytes { get; set; }
    }
}